<!-- 用户列表 -->
<!-- 用户管理 -->
<template>
    <div class="page-box h100 display-flex czbj">
        <p class="title-label">用户列表</p>
        <div class="mt10">
            <dxtable czWidth="240" :dataJson="dataJson" :formJson="formJson" :portUrl="portUrl" :isshowXz="false" :qx="qx"
                ref="databale">
            </dxtable>
        </div>
    </div>
</template>
<script lang='ts' setup>
import dxtable from "./../../components/util/dxtable.vue";
import { dxget, dxpost, qurl, hf } from "./../../util/index";
import { h, ref, reactive } from "vue";
import { NButton } from "naive-ui"
import expenseCalendar from "./expenseCalendar.vue";
const showModal = ref(false)
const openid = ref()
const initeer = () => {
    databale.value.initDataExpose();
};
const databale = ref();
// 弹窗公用该列表
let dataJson = reactive([
    {
        title: '头像',
        key: 'headimgurl',
        render(row) {
            return h('img', { class: "dsfsdtrtr", src: row.headimgurl })
        }
    },
    {
        title: "昵称",
        key: "nickname",
        search: true, // 是否在搜索栏展示
    },
    {
        title: "openid",
        key: "openid",
    },

    {
        title: "登录ip",
        key: "ip",
    },
    {
        title: "所在城市",
        key: "city",
    },
]);
const Userid = localStorage.id
let portUrl = "hbcj/wxcharUser_hbcj";
const qx = {
    DeletePermissionID: "redRuserlistdel", //删除
    EditPermissionIdentifier: "redRuserlistbj", // 编辑
    NewPermissionIdentifier: "redRuserlistxz", // 新建
    ViewPermissionID: "redRuserlistck", // 查看
};
let formJson = reactive([

    {
        title: "头像",
        key: "headimgurl",
        type: "img",
        required: true,
    },
    {
        title: "昵称",
        key: "nickname",
        type: "input",
    }
])
// const czFun = {
//     fun: (row) => {
//         const userType = row.userType
//         return [
//             h(
//                 NButton,
//                 {
//                     type: "info",
//                     quaternary: true,
//                     onClick: async (e) => {
//                         let jjnhe = 2
//                         if (userType == 2) {
//                             jjnhe = 1
//                         }
//                         await dxpost(portUrl, { id: row.id, userType: jjnhe }, 'put')
//                         row.userType = jjnhe
//                     },
//                 },
//                 userType == '2' ? '设为普通' : "设为高质量"
//             ),
//             h(
//                 NButton,
//                 {
//                     type: "info",
//                     quaternary: true,
//                     onClick: async (e) => {
//                         openid.value = row.openid
//                         showModal.value  = true
//                     },
//                 },
//                 "消费记录"
//             ),
//         ];
//     },
// };
</script>


